package org.admanager.mapping.plugin.diagram.part;

import java.util.Collections;
import java.util.List;

import org.admanager.mapping.plugin.diagram.providers.SOADManagementMetamodelElementTypes;
import org.eclipse.gef.Tool;
import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteDrawer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.ToolEntry;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;

/**
 * @generated
 */
public class SOADManagementMetamodelPaletteFactory {

	/**
	 * @generated
	 */
	public void fillPalette(PaletteRoot paletteRoot) {
		paletteRoot.add(createMappingelement1Group());
		paletteRoot.add(createRelationship2Group());
	}

	/**
	 * Creates "Mapping element" palette tool group
	 * @generated
	 */
	private PaletteContainer createMappingelement1Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Messages.Mappingelement1Group_title);
		paletteContainer.setId("createMappingelement1Group"); //$NON-NLS-1$
		paletteContainer.add(createCompositeMapping1CreationTool());
		paletteContainer.add(createComponentMapping2CreationTool());
		paletteContainer.add(createReferenceMapping3CreationTool());
		paletteContainer.add(createServiceMapping4CreationTool());
		paletteContainer.add(createComponentReferenceMapping5CreationTool());
		paletteContainer.add(createComponentServiceMapping6CreationTool());
		return paletteContainer;
	}

	/**
	 * Creates "Relationship" palette tool group
	 * @generated
	 */
	private PaletteContainer createRelationship2Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Messages.Relationship2Group_title);
		paletteContainer.setId("createRelationship2Group"); //$NON-NLS-1$
		paletteContainer.add(createComponentMappingSource1CreationTool());
		paletteContainer.add(createComponentMappingTarget2CreationTool());
		paletteContainer.add(createReferenceMappingSource3CreationTool());
		paletteContainer.add(createReferenceMappingTarget4CreationTool());
		paletteContainer.add(createServiceMappingSource5CreationTool());
		paletteContainer.add(createServiceMappingTarget6CreationTool());
		paletteContainer
				.add(createComponentReferenceMappingSource7CreationTool());
		paletteContainer
				.add(createComponentReferenceMappingTarget8CreationTool());
		paletteContainer
				.add(createComponentServiceMappingSource9CreationTool());
		paletteContainer
				.add(createComponentServiceMappingTarget10CreationTool());
		paletteContainer.add(createCompositeMappingSource11CreationTool());
		paletteContainer.add(createCompositeMappingTarget12CreationTool());
		return paletteContainer;
	}

	/**
	 * @generated
	 */
	private ToolEntry createCompositeMapping1CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.CompositeMapping1CreationTool_title,
				Messages.CompositeMapping1CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.CompositeMapping_2012));
		entry.setId("createCompositeMapping1CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/CompositeMapping.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/CompositeMapping.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentMapping2CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ComponentMapping2CreationTool_title,
				Messages.ComponentMapping2CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentMapping_2013));
		entry.setId("createComponentMapping2CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ComponentMapping.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ComponentMapping.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createReferenceMapping3CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ReferenceMapping3CreationTool_title,
				Messages.ReferenceMapping3CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ReferenceMapping_2015));
		entry.setId("createReferenceMapping3CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ReferenceMapping.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ReferenceMapping.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createServiceMapping4CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ServiceMapping4CreationTool_title,
				Messages.ServiceMapping4CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ServiceMapping_2014));
		entry.setId("createServiceMapping4CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ServiceMapping.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ServiceMapping.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentReferenceMapping5CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ComponentReferenceMapping5CreationTool_title,
				Messages.ComponentReferenceMapping5CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentReferenceMapping_2010));
		entry.setId("createComponentReferenceMapping5CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ComponentReferenceMapping.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ComponentReferenceMapping.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentServiceMapping6CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.ComponentServiceMapping6CreationTool_title,
				Messages.ComponentServiceMapping6CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentServiceMapping_2011));
		entry.setId("createComponentServiceMapping6CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ComponentServiceMapping.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/ComponentServiceMapping.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentMappingSource1CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentMappingSource1CreationTool_title,
				Messages.ComponentMappingSource1CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentMappingSource_4019));
		entry.setId("createComponentMappingSource1CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentMappingTarget2CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentMappingTarget2CreationTool_title,
				Messages.ComponentMappingTarget2CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentMappingTarget_4018));
		entry.setId("createComponentMappingTarget2CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createReferenceMappingSource3CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ReferenceMappingSource3CreationTool_title,
				Messages.ReferenceMappingSource3CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ReferenceMappingSource_4017));
		entry.setId("createReferenceMappingSource3CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createReferenceMappingTarget4CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ReferenceMappingTarget4CreationTool_title,
				Messages.ReferenceMappingTarget4CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ReferenceMappingTarget_4016));
		entry.setId("createReferenceMappingTarget4CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createServiceMappingSource5CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ServiceMappingSource5CreationTool_title,
				Messages.ServiceMappingSource5CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ServiceMappingSource_4014));
		entry.setId("createServiceMappingSource5CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createServiceMappingTarget6CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ServiceMappingTarget6CreationTool_title,
				Messages.ServiceMappingTarget6CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ServiceMappingTarget_4015));
		entry.setId("createServiceMappingTarget6CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentReferenceMappingSource7CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentReferenceMappingSource7CreationTool_title,
				Messages.ComponentReferenceMappingSource7CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentReferenceMappingSource_4022));
		entry.setId("createComponentReferenceMappingSource7CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentReferenceMappingTarget8CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentReferenceMappingTarget8CreationTool_title,
				Messages.ComponentReferenceMappingTarget8CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentReferenceMappingTarget_4021));
		entry.setId("createComponentReferenceMappingTarget8CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentServiceMappingSource9CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentServiceMappingSource9CreationTool_title,
				Messages.ComponentServiceMappingSource9CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentServiceMappingSource_4020));
		entry.setId("createComponentServiceMappingSource9CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentServiceMappingTarget10CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ComponentServiceMappingTarget10CreationTool_title,
				Messages.ComponentServiceMappingTarget10CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.ComponentServiceMappingTarget_4024));
		entry.setId("createComponentServiceMappingTarget10CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createCompositeMappingSource11CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.CompositeMappingSource11CreationTool_title,
				Messages.CompositeMappingSource11CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.CompositeMappingSource_4023));
		entry.setId("createCompositeMappingSource11CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createCompositeMappingTarget12CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.CompositeMappingTarget12CreationTool_title,
				Messages.CompositeMappingTarget12CreationTool_desc,
				Collections
						.singletonList(SOADManagementMetamodelElementTypes.CompositeMappingTarget_4013));
		entry.setId("createCompositeMappingTarget12CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(SOADManagementMetamodelDiagramEditorPlugin
				.findImageDescriptor("/org.admanager.soadmanagement.plugin/icons/full/obj16/Relationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private static class NodeToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/elementTypes;

		/**
		 * @generated
		 */
		private NodeToolEntry(
				String title,
				String description,
				List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/elementTypes) {
			super(title, description, null, null);
			this.elementTypes = elementTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeCreationTool(elementTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}

	/**
	 * @generated
	 */
	private static class LinkToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/relationshipTypes;

		/**
		 * @generated
		 */
		private LinkToolEntry(
				String title,
				String description,
				List/*[org.eclipse.gmf.runtime.emf.type.core.IElementType]*/relationshipTypes) {
			super(title, description, null, null);
			this.relationshipTypes = relationshipTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeConnectionTool(relationshipTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}
}
